package com.jcz.web;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.junit.runner.Request;

import com.jcz.biz.AuctionBiz;
import com.jcz.bizImpl.AuctionBizImpl;
import com.jcz.entity.Auction;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class modifyAction extends ActionSupport {
	private Auction auction=new Auction();
	

	public Auction getAuction() {
		return auction;
	}

	public void setAuction(Auction auction) {
		this.auction = auction;
	}


	AuctionBiz aBiz=new AuctionBizImpl();

	@Override
	public String execute() throws Exception {
		aBiz.updateAuction(auction);
		return "success";
	}




	/*第一次进update页面时执行的方法*/
	public String first(){
		
		HttpServletRequest request=ServletActionContext.getRequest();		
		String id=request.getParameter("id");
		this.setAuction(aBiz.findById(Integer.parseInt(id)));
		return "first";
	}
	
	/*从update页面提交时执行的方法*/
	/*public String upda(){
		aBiz.updateAuction(auction);
		return "success";
	}*/
}
